package cn.yunhe.mybatispluss.entity;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;

@Getter
@Setter
@TableName(value = "t_user")
public class User implements Serializable {
    //value指定主键列的列名，type设置逐渐自增
    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;
    //如果数据库字段是带下划线a_b，实体类是aB，
    //在实体类上属性加上注解 @TableField(value = "a_b")
    private String name;
    private Integer age;

    //如果当前变量在数据库中没有对应的字段，一定加上下面的注解
    @TableField(exist = false)
    private Double salary;



}
